<?php

namespace app\index\validate\consulting;

use ShidianUtil\Thinkphp\Validate\BaseValidate;

/**
 * Class CardMessageComment
 * @package app\consulting\validate
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037623
 */
class CardMessageComment extends BaseValidate
{

    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id'	=> 'isId',
		'consultingId'	=> 'integer|egt:0|max:11',
		'consultingMessageId'	=> 'integer|egt:0|max:11',
		'memberId'	=> 'integer|egt:0|max:11',
		'lawyerId'	=> 'integer|egt:0|max:11',
		'level'	=> 'integer|egt:0|max:11',
		'comment'	=> 'scalar|max:2000',
		'updated'	=> 'integer|egt:0|max:11',
		'created'	=> 'integer|egt:0|max:11',
        'page'      => 'integer|egt:0|max:11',
        'page_size' => 'integer|egt:0|max:11',
    ];

    protected $field = [
        'id'	=> 'id',
		'consultingId'	=> 'consultingId',
		'consultingMessageId'	=> 'consultingMessageId',
		'memberId'	=> 'memberId',
		'lawyerId'	=> 'lawyerId',
		'level'	=> 'level',
		'comment'	=> 'comment',
		'updated'	=> 'updated',
		'created'	=> 'created',
        'page'      => '分页页数',
        'page_size' => '分页大小',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'id.require'	=> '缺少:attribute',
		'id.isId'	=> '请设置正确的:attribute',
		'consultingId.require'	=> '请输入:attribute',
		'consultingId.integer' => ':attribute应该是整数',
		'consultingId.egt'	=> ':attribute应该大于等于:rule',
		'consultingId.max'	=> ':attribute长度不能超过:rule位',
		'consultingMessageId.require'	=> '请输入:attribute',
		'consultingMessageId.integer' => ':attribute应该是整数',
		'consultingMessageId.egt'	=> ':attribute应该大于等于:rule',
		'consultingMessageId.max'	=> ':attribute长度不能超过:rule位',
		'memberId.require'	=> '请输入:attribute',
		'memberId.integer' => ':attribute应该是整数',
		'memberId.egt'	=> ':attribute应该大于等于:rule',
		'memberId.max'	=> ':attribute长度不能超过:rule位',
		'lawyerId.require'	=> '请输入:attribute',
		'lawyerId.integer' => ':attribute应该是整数',
		'lawyerId.egt'	=> ':attribute应该大于等于:rule',
		'lawyerId.max'	=> ':attribute长度不能超过:rule位',
		'level.require'	=> '请输入:attribute',
		'level.integer' => ':attribute应该是整数',
		'level.egt'	=> ':attribute应该大于等于:rule',
		'level.max'	=> ':attribute长度不能超过:rule位',
		'comment.require'	=> '请输入:attribute',
		'comment.scalar' => ':attribute应该是字符串',
		'comment.max'	=> ':attribute长度不能超过:rule位',
		'updated.require'	=> '请输入:attribute',
		'updated.integer' => ':attribute应该是整数',
		'updated.egt'	=> ':attribute应该大于等于:rule',
		'updated.max'	=> ':attribute长度不能超过:rule位',
		'created.require'	=> '请输入:attribute',
		'created.integer' => ':attribute应该是整数',
		'created.egt'	=> ':attribute应该大于等于:rule',
		'created.max'	=> ':attribute长度不能超过:rule位',
        'page.require'      => '请输入:attribute',
        'page.integer'      => ':attribute应该是整数',
        'page.egt'          => ':attribute应该大于等于:rule',
        'page.max'          => ':attribute长度不能超过:rule位',
        'page_size.require' => '请输入:attribute',
        'page_size.integer' => ':attribute应该是整数',
        'page_size.egt'     => ':attribute应该大于等于:rule',
        'page_size.max'     => ':attribute长度不能超过:rule位',
    ];

    protected $scene = [
        'delete' => ['id' => 'require'],
        'index'  => ['page', 'page_size'],
        'read'   => ['id' => 'require'],
        'save'   => ['consultingId', 'consultingMessageId', 'memberId', 'lawyerId', 'level', 'comment', 'updated', 'created'],
    ];

}
